<template>
  <div>
    <el-card>
      <h2>历史记录</h2>
      <el-button type="primary" size="small" icon="el-icon-refresh-right" @click="GetHister">刷新数据</el-button>
    </el-card>
    <el-card>
      <el-table :data="TemplateDown.pageList" style="width: 100%" border>
        <el-table-column type="index" prop="id" label="ID">
        </el-table-column>
        <el-table-column prop="fileName" label="文件名">
        </el-table-column>
        <el-table-column prop="rows" label="文件行数">
        </el-table-column>
        <el-table-column prop="encryptionCode" label="加密/解密方式">
        </el-table-column>
        <el-table-column prop="startTime" label="上传时间">
        </el-table-column>
        <el-table-column prop="endTime" label="处理完成时间">
        </el-table-column>
      </el-table>

      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
        :page-sizes="[10, 20, 50, 100]" :page-size="10" layout="total, sizes, prev, pager, next, jumper"
        :total="TemplateDown.totalCount">
      </el-pagination>
    </el-card>
  </div>
</template>

<script>
import {Historical} from '@/api/user'

export default {
  data() {
    return {
      TemplateDown:[],
      pageCode: 1,
      pageSize: 10,
    };
  },
  created() {
    this.GetHister();

  },
  methods: {
   async GetHister(){
    let data = {
      page: this.pageCode,
      pageSize: this.pageSize,
    }
      const res = await Historical(data)
      if(res.code===200){
        this.TemplateDown = res.data
        this.$message.success(res.msg)

      }else{
        this.$message.error(res.msg)

      }
    },
    async handleSizeChange(val) {
      this.pageSize = val;
      this.GetHister();
    },
    async handleCurrentChange(val) {
      this.pageCode = val;
      this.GetHister();
    },
  },
};
</script>

<style lang="scss" scoped>

</style>
